package cn.ruituo.adv7;
public class Thread2{
    public static void main(String[] args) {
        for(int i=1;i<=4;i++){
            Thread th=new Thread(new Thread22());
            th.setName("线程"+i);
            th.start();
        }
        System.out.println("主线程结束了。。。");
    }
}
 class Thread22 implements Runnable {
    @Override
    public void run() {
        for(int i=1;i<=20;i++){
            System.out.println(Thread.currentThread().getName()+" print "+i);
        }
    }
}
